﻿@model Newbe.TestDirector.Notification.Web.Jobs.MailerSenderBookItem
@{
    var bookItem = Model;
}
<style type="text/css">
    div.bug {
    }

        div.bug table {
            border: 1.0pt solid windowtext;
        }

            div.bug table thead {
                background-color: azure;
                color: windowtext;
            }

                div.bug table thead tr th {
                    color: windowtext;
                    border: 1.0pt solid windowtext;
                }

            div.bug table tbody tr {
                max-height: 600px;
            }

                div.bug table tbody tr td {
                    color: windowtext;
                    border: 1.0pt solid windowtext;
                    max-width: 800px;
                }

                div.bug table tbody tr:nth-child(odd) {
                    background: #F4F4F4;
                }

                div.bug table tbody tr:hover {
                    background: azure;
                    color: #FFF;
                }
</style>
@foreach (var bookItemMatchedScene in bookItem.MatchedScenes)
{
    <p style="font-size:24pt">@bookItemMatchedScene.Key.Name</p>
    var sourceData = bookItemMatchedScene.Value.Select(x => x.NowData).AsEnumerable();
    <div class="bug">
        <table style=" border: 1.0pt solid windowtext;">
            <thead style="background-color: azure;color: windowtext;">
                <tr style="color: windowtext;border: 1.0pt solid windowtext;">
                    @foreach (var col in bookItemMatchedScene.Key.ShowColumns)
                {
                        <th>@(col.TableColumn.DisplayName ?? col.TableColumn.ColumnName)</th>
                    }
                </tr>
            </thead>
            <tbody>
                @foreach (var row in sourceData)
                {
                    <tr style="max-height: 600px;">
                        @foreach (var col in bookItemMatchedScene.Key.ShowColumns)
                    {
                            <td style="color: windowtext;border: 1.0pt solid windowtext;max-width: 800px;">@row[col.TableColumn.ColumnName]</td>
                        }
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <hr />
}
